
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="/template/main.xhtml">

	<ui:define name="body">
		<h:form>
			<p:toolbar  >
				<p:toolbarGroup align="left">
					<p:commandButton  title="#{messages['button.new']}" icon="ui-icon-document" action="#{clienteListMB.getNextView}"
						actionListener="#{clienteListMB.clear}" ajax="false" />

					<p:commandButton  title="#{messages['button.delete']}" icon="ui-icon-trash" onclick="confirmation.show()"
						type="button" immediate="true" ajax="false" />

					<p:dialog style="position: absolute; left:50px; top:50px;"  message="#{messages['label.confirm.delete']}" showEffect="bounce" hideEffect="explode"
						header="#{messages['label.dialog.alert']}!" severity="alert" widgetVar="confirmation">

						<h:commandButton value="#{messages['button.dialog.yes']}" action="#{clienteListMB.deleteSelection}"
							actionListener="#{clienteListMB.clear}" />
						<h:commandButton value="#{messages['button.dialog.no']}" onclick="confirmation.hide()" type="button" />
					</p:dialog>
				</p:toolbarGroup>
			</p:toolbar>
			
			<ui:include src="cliente_grid.xhtml" >
				<ui:param name="listaClientes" value="#{clienteListMB.resultList}"/>
			</ui:include>

		</h:form>

	</ui:define>
	
	<ui:define name="selecao">
		<h:selectBooleanCheckbox value="#{clienteListMB.selection[cliente.id]}"  />
	</ui:define>
	
</ui:composition>